class Solution {
public:
    int a[33];
    bool canConstruct(string ransomNote, string magazine) {
        //97 -- 122
        for(int i = 0;i<magazine.size();++i)
        {
            a[magazine[i]-97 ]++;
        }
        for(int j = 0;j<ransomNote.size();++j)
        {
            if(a[ransomNote[j] -97] > 0)a[ransomNote[j]-97]--;
            else return false;
        }
    return true;
    }
};
